HTTP to HTTPS Redirect
(QW.HTTPtoHTTPSRedirect)
Overview
This is a private feature developed by Qwilt.
If you want to block your site from being accessed over HTTP, you can configure an HTTP to HTTPS Redirect to force the CDN to redirect HTTP requests to HTTPs. The configuration also sets the response code.
Example
This example forces an HTTP to HTTPS redirect with status code 301.
{
"generic-metadata-type": "MI.PrivateFeature.Qwilt.QW.HTTPtoHTTPSRedirect",
"generic-metadata-value": {
"allow-redirect": true,
"redirect-code": "301"
}
}
Supported Properties
Field | Valid Values | Description |
---|---|---|
allow-redirect | true, false | Enables or disables the redirect. |
redirect-code | 301, 302, 307, 308 | A string specifying the HTTP status code for the redirect. Required if allow-redirect is true. |
Supported Status Code Descriptions
Status Code | Description |
---|---|
301 | Permanent redirect that tells the client the resource is permanently moved to the new HTTPS URL. This is the default status code value. |
302 | Temporary redirect that tells the client the resource is temporarily located at the new HTTPs URL. |
307 | Temporary redirect that also ensures that the HTTP method and body remain unchanged in the redirected request. Use this code when it's critical to maintain the original request method and body (such as for POST requests). |
308 | Permanent redirect that also ensures that the HTTP method and body remain unchanged in the redirected request. Use this code when it's critical to maintain the original request method and body (such as for POST requests). |